import pandas as pd
from pandas import DataFrame

datafile = './文本/客运量_1-1.csv' 
datafile2 = './文本/货运量_1-1.csv'

data = pd.DataFrame(pd.read_csv(datafile))
data2 = pd.DataFrame(pd.read_csv(datafile2))

#找到Whole year的值不为0的机场
data_sum = data.loc[data['Whole year'] != 0]
data2_sum = data2.loc[data2['Whole year'] != 0]
#保存文件
data_sum.to_csv(datafile,index = False,encoding = 'utf_8_sig')
data2_sum.to_csv(datafile2,index = False,encoding = 'utf_8_sig')